package cool.taomu.toolkit.service.kademlia.provider

import com.google.inject.Inject
import cool.taomu.toolkit.service.kademlia.entity.KPeerNode
import cool.taomu.toolkit.service.kademlia.service.KRoutingTable
import javax.inject.Named
import javax.inject.Provider
import org.slf4j.LoggerFactory

@Deprecated
class RoutingTableProvider implements Provider<KRoutingTable> {
    val static LOG = LoggerFactory.getLogger(RoutingTableProvider);
    
    @Inject(optional=true)
    @Named("taomu.kademlia.k")
    int k = 8;

    @Inject
    @Named("taomu.toolkit.kademlia.local.node")
    KPeerNode localNode

    override get() {
        LOG.info("创建KRoutingTable实例");
        return new KRoutingTable();
    }
}
